package br.org.etec.dotcao.model;

import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Table(name = "ttestimony")
@Entity
public class Testimony extends AbstractEntity {

	private static final long serialVersionUID = 1L;

	@Temporal(TemporalType.TIMESTAMP)
	private Date date;

	@Column
	private String content;

	@Column
	private String subject;

	@ManyToOne
	@JoinColumn(name = "sender")
	private User sender;

	@OneToMany(cascade = CascadeType.ALL, mappedBy = "testimony")
	private List<TestimonyComment> comments;

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getSubject() {
		return subject;
	}

	public void setSubject(String subject) {
		this.subject = subject;
	}

	public User getSender() {
		return sender;
	}

	public void setSender(User sender) {
		this.sender = sender;
	}

	public List<TestimonyComment> getComments() {
		return comments;
	}

	public void setComments(List<TestimonyComment> comments) {
		this.comments = comments;
	}
}
